#!/usr/bin/env python
#    rsp_soppa1excinosymm
#    --------------------
#    Molecule:         H2O
#    Wave Function:    MP2 (SOPPA) / cc-pVDZ
#    Test Purpose:     Singlet excitation energies. No symmetry

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

f.add(from_string = 'Atoms and basis sets',
      num_lines = 15,
      rel_tolerance = 1.0e-2)

f.add(from_string = 'Cartesian Coordinates',
      num_lines = 10,
      rel_tolerance = 1.0e-8)

f.add(string = 'Hartree-Fock total energy',
      rel_tolerance = 1.0e-8)
 
f.add(string = '= MP2 second order energy',
      rel_tolerance = 1.0e-8)

f.add(re = '4 Excitation energies are calculated for symmetry no\. * 1',
      rel_tolerance = 1.0e-2)

f.add(re = '3 property residues are calculated with labels\:',
      rel_tolerance = 1.0e-2)

f.add(string = ' STATE NO: ',
      ignore_sign = True,
      abs_tolerance = 1.0e-5)
     
f.add(string = '@ Excitation energy :',
      abs_tolerance = 1.0e-5)

f.add(string = 'Total energy :',
      rel_tolerance = 1.0e-5)

f.add(string = '@ Oscillator strength (LENGTH)',
      ignore_sign = True,
      abs_tolerance = 1.0e-3)

f.add(string = 'SOPPA  p-h  weight',
      rel_tolerance = 1.0e-3)

f.add(string = 'SOPPA 2p-2h weight',
      rel_tolerance = 1.0e-3)

test.run(['rsp_soppa1excinosymm.dal'], ['H2O_cc-pVDZ_nosym.mol'], f={'out': f},
         accepted_errors=['not implemented for parallel calculations.'])

sys.exit(test.return_code)
